{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.5 Lift Check Valves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A lift check valve of type globe (with a wing-guided disc) is added to a 80 mm Schedule 40 horizontal pipe carying water at a flow rate of 300 L/min.\n",
    "\n",
    "Calculate the check valve size, and pressure drop. The disc should be fully lifted at the specified flow."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Minimum velocity = 1.582563779 meter / second\n",
      "Velocity in 80 mm valve = 1.04907178712 meter / second\n",
      "Minimum velocity = 1.02523019353 meter / second\n",
      "Velocity in 60 mm valve = 1.61936609196 meter / second\n",
      "Loss coefficient = 24.8796766231 dimensionless\n",
      "Pressure drop = 13666.0409068 pascal\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import *\n",
    "from math import *\n",
    "Q = 300*u.L/u.min\n",
    "D_80 = 77.9*u.mm\n",
    "\n",
    "rho = 998.2*u.kg/u.m**3\n",
    "# Try: schedule 40, 80 mm valve\n",
    "D_60 = 62.7*u.mm\n",
    "v_lift = v_lift_valve_Crane(rho=rho, D1=D_80, D2=D_80, style='lift check straight')\n",
    "print('Minimum velocity = %s' %v_lift)\n",
    "\n",
    "v =  Q/(pi/4*D_80**2)\n",
    "print('Velocity in 80 mm valve = %s' %v.to_base_units())\n",
    "\n",
    "# v is lower than the lift velocity; try the 60 mm valve\n",
    "v_lift = v_lift_valve_Crane(rho=rho, D1=D_60, D2=D_80, style='lift check straight')\n",
    "print('Minimum velocity = %s' %v_lift)\n",
    "\n",
    "v =  Q/(pi/4*D_60**2)\n",
    "print('Velocity in 60 mm valve = %s' %v.to_base_units())\n",
    "# The desired velocity is close enough\n",
    "\n",
    "fd = 0.017 # given, 80 mm pipe upstream\n",
    "K2 = K_lift_check_valve_Crane(D_60, D_80, fd=fd, angled=False)\n",
    "print('Loss coefficient = %s'%K2)\n",
    "v_pipe = Q/(pi/4*D_80**2)\n",
    "\n",
    "dP = 0.5*rho*v_pipe**2*K2\n",
    "print('Pressure drop = %s' %dP.to(u.Pa))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "The values calculated in the example are K2 = 26.3 and pressure drop = 14450 Pa. Interestingly, the formula for minimum lift velocity used in their example does not use the ratio of diameters as the formula in their appendix shows. Otherwise the examples match.\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
